<?php

$db = DB::getInstance();

$group = Request::get("group");
$query = Request::get("query");

$errorInfo = array();

if($group) {
	try {
		$sql = "select * from gc_config where group_name = ?";
		$data = array($group);
		if($query) {
			$sql .= " and `key` like ?";
			$data[] = $query . '%';
		}
		$result = $db->query($sql, $data);
		$result['group'] = $group;
		$result['query'] = $query;
	} catch (Exception $e) {
		$errorInfo[] = $e->getMessage();
	}
} else {
	Response::redirect("/?module=group");
}

return $result;
